package com.shopping.mall.core.module.order.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.shopping.mall.base.util.UUIDUtils;
import com.shopping.mall.core.module.goods.entity.Goods;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@TableName("order_good")
public class OrderGood {
    @TableId(type = IdType.UUID)
    private String id;

    private String orderId;

    private String goodId;

    private String specificationId;

    private Integer number;



    @TableField(exist = false)
    private Goods good;

    public OrderGood() {
    }

    public OrderGood(String orderId, String goodId, String specificationId, Integer number) {
        this.orderId = orderId;
        this.goodId = goodId;
        this.specificationId = specificationId;
        this.number = number;
        this.id= UUIDUtils.getRandUUID();
    }

    public OrderGood(String orderId, String goodId, String specificationId, Integer number, Goods good) {
        this.orderId = orderId;
        this.goodId = goodId;
        this.specificationId = specificationId;
        this.number = number;
        this.good = good;
    }
}
